-- @owner: songjing20
-- @date: 2024-09-25
-- @testpoint: 支持游标并行--smp开关打开，query_dop >1,游标中的查询支持smp计划，但未声明no scroll,合理报错

--prestep1:切换A库;expect:执行成功
@conn PrimaryDbAmode;
show sql_compatibility;

--step1:设置查看游标并行计划的参数;expect:成功
set enable_auto_explain = on;
set auto_explain_level = notice;

--step2:开启并行参数;expect:成功
set query_dop=10;

--step3:建表;expect:成功
drop table if exists t1 cascade;
create table t1(a int, b int, c int, d bigint);
insert into t1 values(generate_series(1, 100), generate_series(1, 10), generate_series(1, 2), generate_series(1, 50));
analyze t1;

--step4:标中的查询支持smp计划，但未声明no scroll;expect:不支持游标并行
begin;
declare cursor1 cursor for select * from t1;
fetch cursor1;
end;
/

--step5:清理环境;expect:成功
reset query_dop;
reset enable_auto_explain;
reset auto_explain_level;
drop table t1;

